﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Medianamik.Core;
using NUnit.Framework;
using SubSonic;

namespace Medianamik.Tests.Unit.Medianamik.Core
{
    [TestFixture]
    public class NodeTypeNameValidatorTest
    {
        private NodeTypeNameValidator _validator;
        [SetUp]
        public void Init()
        {
            _validator = new NodeTypeNameValidator(new CSharpCodeLanguage());
        }
        [Test]
        public void Type_name_cannot_contain_csharp_reserved_words()
        {
            Assert.IsFalse(_validator.Validate("event"));
            Assert.IsFalse(_validator.Validate("Event"));
            Assert.IsFalse(_validator.Validate("object"));
            Assert.IsFalse(_validator.Validate("Object"));
        }

        [Test]
        public void Type_name_must_start_with_uppercase_letter()
        {
            Assert.IsFalse(_validator.Validate("test"));
            Assert.IsTrue(_validator.Validate("Test"));
        }

        [Test]
        public void Type_name_cannot_cannot_start_with_numeric_character()
        {
            Assert.IsFalse(_validator.Validate("1test"));
            Assert.IsFalse(_validator.Validate("1AbsoCorpoBlocCitation"));
        }


        
    }
}